/*-------------login validate--------------*/
$(document).ready(function() {
	init();
});

function init() {
	$("#submit").bind("click", function() {
		var username = $("#username").val();
		var password = $("#password").val();
		isPassportValidate(username, password);
	});
}

function isPassportValidate(passport, password) {
	$.getJSON("../Login", {
		passport : passport,
		password : password
	}, function(result) {
		if (result == true) {
			window.location.assign("admin/manage.jsp");
		} else {
			$("#error").html("Incorrect username or password");
		}
	})
}